import java.awt.Point;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.swing.*;
/**
 * @author 
 * @version
 * @since
 * 
 * */

public class GamePanel extends JPanel {
	private State state;
	private NewGame game;
	private MapPanel map;

	/**
	 * 
	 * */
	public static enum State {
		MapPanel, TownPanel
	}
	
	/**
	 * Validates this container and all of its subcomponents. 
	 * */
	public GamePanel(){
		validate();
		setFocusable(true);
		setFocusCycleRoot(true);
	}
	
	/**
	 * Set game 
	 * @param g the game class
	 */
	public void setGame(NewGame g){
		game = g;
	}
	
	/**
	 * Change the jpanel display.
	 * */
	public void changeDisp(JPanel display){
		removeAll();
		add(display);
		validate();
		repaint();
	}
	
	public void addMapPanel(MapPanel panel){
		map = panel;
		//transferFocusDownCycle();
		changeDisp(panel);
	}
	
	
	/**
	 * Setting the state
	 * */
	public void setState(State state) {
		this.state = state;
	}
	
	/**
	 * @return return the current state in game.
	 * */
	public State getState() {
		return state;
	}
	
}
